#ifndef USERMODEL_H
#define USERMODEL_H

#include "model/singletonbd.h"

class UserModel
{
public:
    static UserModel * getInstance();


    /** 根据用户密码查询
     * @brief selectUserByNameAndPwd
     * @param name
     * @param pwd
     * @return
     */
    int selectUserByNameAndPwd(QString name, QString pwd);

    //更改用户状态--登陆成功
    int updateUserByName(QString name);

    //所用用户离线
    int updateUserAll();

    //查询在线的用户id
    int selectUserId(char **&qres, int &row, int &col);
private:
    UserModel();
    static UserModel *instance;
};

#endif // USERMODEL_H
